<html>
<head><meta charset="utf-8"><title>incremental compilation question · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html">incremental compilation question</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="200968610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/200968610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#200968610">(Jun 16 2020 at 03:00)</a>:</h4>
<p>Why does cargo recompile crates that depend on a changed crate even if there are no public API changes? Has it just not been implemented yet?</p>



<a name="200969948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/200969948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#200969948">(Jun 16 2020 at 03:36)</a>:</h4>
<p>Cargo doesn't understand any of the details of the actual crate source code, so it always needs to re-run rustc</p>



<a name="200969974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/200969974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#200969974">(Jun 16 2020 at 03:37)</a>:</h4>
<p>On top of that, changing private functions can legitimately cause other crates to need to recompiled, due to inlining</p>



<a name="200970052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/200970052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#200970052">(Jun 16 2020 at 03:39)</a>:</h4>
<p>also, I don't think the currently incremental compilation infrastructure allows determining if only private functions have changed</p>



<a name="200970065"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/200970065" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#200970065">(Jun 16 2020 at 03:39)</a>:</h4>
<p>not all query results are serialized to disk, and not everything is query-ified</p>



<a name="200971033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/200971033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#200971033">(Jun 16 2020 at 04:05)</a>:</h4>
<p><span class="user-mention silent" data-user-id="125294">Aaron Hill</span> <a href="#narrow/stream/131828-t-compiler/topic/incremental.20compilation.20question/near/200970052">said</a>:</p>
<blockquote>
<p>also, I don't think the currently incremental compilation infrastructure allows determining if only private functions have changed</p>
</blockquote>
<p>Hmm... I think you might still need to rebuild the other crate if the private function was inlined into a public one or if a public inlined function uses a private type that changed...</p>



<a name="201053835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/201053835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#201053835">(Jun 16 2020 at 18:13)</a>:</h4>
<p>Couldn't Cargo theoretically only re-run codegen and skip everything else?</p>



<a name="201054004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/201054004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#201054004">(Jun 16 2020 at 18:15)</a>:</h4>
<p>Codegen is often the most expensive part</p>



<a name="201055024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/201055024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#201055024">(Jun 16 2020 at 18:22)</a>:</h4>
<p>Wouldn't it still cut down a bit on compile times?</p>



<a name="201056626"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/201056626" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#201056626">(Jun 16 2020 at 18:35)</a>:</h4>
<p>Sure, but how would Cargo know when it can do this? Why not use the existing incremental compilation support for this? Pretty sure that already works cross-crate to some extent.</p>



<a name="201057291"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/201057291" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#201057291">(Jun 16 2020 at 18:41)</a>:</h4>
<p>I guess I'll have to read up on incremental compilation :)</p>



<a name="201058004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/201058004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#201058004">(Jun 16 2020 at 18:47)</a>:</h4>
<p>I noticed that <code>./x.py</code> seems to compile rustc in release mode. Is there a way to compile in dev mode, which I assume would be much faster?</p>



<a name="201058130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/201058130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#201058130">(Jun 16 2020 at 18:48)</a>:</h4>
<p>See <code>config.toml</code>:</p>
<div class="codehilite"><pre><span></span><code># Whether or not to optimize the compiler and standard library.
#
# Note: the slowness of the non optimized compiler compiling itself usually
#       outweighs the time gains in not doing optimizations, therefore a
#       full bootstrap takes much more time with `optimize` set to false.
#optimize = true
</code></pre></div>



<a name="201059496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/201059496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#201059496">(Jun 16 2020 at 18:59)</a>:</h4>
<p>If I'm just doing Stage 1, then dev mode would probably be faster since the compiler isn't compiling itself, right?</p>



<a name="201059529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/201059529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#201059529">(Jun 16 2020 at 18:59)</a>:</h4>
<p>Or have I mixed it up?</p>



<a name="201059616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/201059616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#201059616">(Jun 16 2020 at 19:00)</a>:</h4>
<p>it still builds libstd</p>



<a name="201060107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/201060107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#201060107">(Jun 16 2020 at 19:04)</a>:</h4>
<p>So you recommend using release mode?</p>



<a name="201066318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/201066318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#201066318">(Jun 16 2020 at 19:59)</a>:</h4>
<p>In my experience, the gains from building in debug mode are far outweighted by the additional time taken to run <code>./x.py test</code></p>



<a name="201066364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/201066364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#201066364">(Jun 16 2020 at 19:59)</a>:</h4>
<p>though the last time I tried that was several months ago</p>



<a name="201066629"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/201066629" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#201066629">(Jun 16 2020 at 20:01)</a>:</h4>
<p>its not clear from this conversation, so just to be clear: The <code>optimize</code> and <code>debug</code> settings in <code>config.toml</code> for <code>rustc</code> are completely independent knobs</p>



<a name="201066728"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/201066728" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#201066728">(Jun 16 2020 at 20:02)</a>:</h4>
<p>i.e. saying "dev mode" versus "release mode" isn't clearly conveying what <code>config.toml</code> changes you are suggesting</p>



<a name="201066795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/201066795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#201066795">(Jun 16 2020 at 20:02)</a>:</h4>
<p>(and yes, pretty much everyone leaves <code>optimize</code> set to its default of <code>true</code>, due to the drawbacks listed in the <code>config.toml</code> comments.)</p>



<a name="201066975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/201066975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#201066975">(Jun 16 2020 at 20:04)</a>:</h4>
<p>I've also found that builds with debug info make the linker use a huge amount of memory.</p>



<a name="201067017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/201067017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#201067017">(Jun 16 2020 at 20:04)</a>:</h4>
<p>good point - I meant to say <code>optimize = false</code> rather than <code>debug = false</code></p>



<a name="201067236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/201067236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#201067236">(Jun 16 2020 at 20:06)</a>:</h4>
<p>I've set <code>debuginfo-level=1</code> rather than <code>debug=true</code>, due to extreme disk space usage requirements of <code>debug=true</code></p>



<a name="201067325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/201067325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#201067325">(Jun 16 2020 at 20:07)</a>:</h4>
<p>it's so bad that it uncovered a bug in backtrace printing <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span> (<a href="https://github.com/rust-lang/rust/issues/69151">https://github.com/rust-lang/rust/issues/69151</a>)</p>



<a name="201087691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/201087691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#201087691">(Jun 16 2020 at 23:47)</a>:</h4>
<p>So the summary is:</p>
<ul>
<li>set <code>optimize</code> to <code>true</code></li>
<li>set <code>debug</code> to <code>false</code>, unless you are stepping through in a debugger</li>
</ul>
<p>Is that correct?</p>



<a name="201154834"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/201154834" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#201154834">(Jun 17 2020 at 15:08)</a>:</h4>
<p>I tend to set <code>debug=true</code> regardless personally... but then again I also tend to run out of memory and disk space too... I guess it depends on what you are doing and what machine you are building on.</p>



<a name="202046037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/202046037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#202046037">(Jun 26 2020 at 02:13)</a>:</h4>
<p><code>debug = true</code> is still a bad development default IMO</p>
<p>I manually set <code>debuginfo-level = 1</code> (gives you backtraces) and <code>debug-assertions = true</code> (gives you <code>debug!</code> logging)</p>



<a name="202046094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/202046094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#202046094">(Jun 26 2020 at 02:14)</a>:</h4>
<p>I could see <code>debuginfo-level-std = 2</code>, if you're trying to debug a compiled program, but debugging <code>rustc</code> in an actual debugger doesn't seem realistic</p>



<a name="202609456"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/202609456" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#202609456">(Jul 01 2020 at 18:58)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/131828-t-compiler/topic/incremental.20compilation.20question/near/202046037">said</a>:</p>
<blockquote>
<p><code>debug = true</code> is still a bad development default IMO</p>
</blockquote>
<p>We probably should be treating this as a bug to be addressed. For example, if <code>debug = true</code> is so resource-intensive as to be useless, then we should change its meaning (or provide more than a boolean for its value, so that we can provide a one-stop-shop for people looking to adopt "best practice for rustc development env."</p>



<a name="202620621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/202620621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#202620621">(Jul 01 2020 at 20:33)</a>:</h4>
<p><span class="user-mention" data-user-id="116083">@pnkfelix</span> I think it's also been broken for a while, as in &gt;2GB of debuginfo causes crashes in libbacktrace. or maybe that was from LLVM debuginfo, rustc's might be smaller</p>



<a name="202620734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/202620734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#202620734">(Jul 01 2020 at 20:34)</a>:</h4>
<p>I keep coming across <code>debug = true</code> once every few months and I don't have the energy to fight about it, last time I looked it seemed by debuginfo level being 2 was a knowing decision</p>



<a name="202625471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/202625471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#202625471">(Jul 01 2020 at 21:19)</a>:</h4>
<p>It seems <em>entirely</em> reasonable to me to just change the default, and change the comment to say "only change this to <code>true</code> if you want to run rustc in a debugger".</p>



<a name="202628661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/202628661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#202628661">(Jul 01 2020 at 21:55)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/131828-t-compiler/topic/incremental.20compilation.20question/near/202620621">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="116083">pnkfelix</span> I think it's also been broken for a while, as in &gt;2GB of debuginfo causes crashes in libbacktrace. or maybe that was from LLVM debuginfo, rustc's might be smaller</p>
</blockquote>
<p>the &gt; 2gb crash should have been fixed a while ago</p>



<a name="202628675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/202628675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#202628675">(Jul 01 2020 at 21:55)</a>:</h4>
<p>which is not to say that having &gt; 2gb of debug info is a good idea</p>



<a name="202676696"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/202676696" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#202676696">(Jul 02 2020 at 11:42)</a>:</h4>
<p>I'll see if I can make a PR changing the default sometime this week</p>



<a name="202676714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/202676714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#202676714">(Jul 02 2020 at 11:42)</a>:</h4>
<p>I'll change a bunch of other defaults at the same time just so they can see discussion, if people agree on things I can split those into a separate PR</p>



<a name="202685794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/202685794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#202685794">(Jul 02 2020 at 13:14)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/73964">https://github.com/rust-lang/rust/pull/73964</a></p>



<a name="202696532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/202696532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#202696532">(Jul 02 2020 at 14:34)</a>:</h4>
<p>This should probably be an MCP so I opened one: <a href="https://github.com/rust-lang/compiler-team/issues/326">https://github.com/rust-lang/compiler-team/issues/326</a></p>



<a name="202712040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/202712040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nadrieril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#202712040">(Jul 02 2020 at 16:32)</a>:</h4>
<p>Would it be possible to set optimize=false only for some crates? Say I work on rustc_mir_build, what if all of the compiler is optimized except that crate? That would mean much shorter recompilation when I touch that crate, but still tolerable test performance</p>



<a name="202712165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/202712165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#202712165">(Jul 02 2020 at 16:33)</a>:</h4>
<p>You can use <code>[profile.release.package.crate_name]</code> in <code>Cargo.toml</code> for that.</p>



<a name="202712684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/202712684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nadrieril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#202712684">(Jul 02 2020 at 16:37)</a>:</h4>
<p>In the top-level Cargo.toml?</p>



<a name="202712829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/202712829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#202712829">(Jul 02 2020 at 16:38)</a>:</h4>
<p>Yes</p>



<a name="202712878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/202712878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nadrieril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#202712878">(Jul 02 2020 at 16:38)</a>:</h4>
<p>ohh yeah I see things like that! Amazing thanks, you might have significantly improved my life x)</p>



<a name="202742705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/202742705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#202742705">(Jul 02 2020 at 20:48)</a>:</h4>
<p>Oh, that would be worth adding to <a href="https://rustc-dev-guide.rust-lang.org/building/suggested.html">https://rustc-dev-guide.rust-lang.org/building/suggested.html</a></p>



<a name="202742715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/202742715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#202742715">(Jul 02 2020 at 20:48)</a>:</h4>
<p>Would you mind making a quick PR?</p>



<a name="202746090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incremental%20compilation%20question/near/202746090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nadrieril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incremental.20compilation.20question.html#202746090">(Jul 02 2020 at 21:21)</a>:</h4>
<p>Done :) <a href="https://github.com/rust-lang/rustc-dev-guide/pull/780">https://github.com/rust-lang/rustc-dev-guide/pull/780</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>